<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="业务单复制" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<script src="/js/QueryList.js"></script>
<script language="javascript">
	function doSearch(){
		var clientId="${clientId}";
		var searchKey=encodeURIComponent(document.getElementById("search_key").value.trim());
		window.location="/business/BusinessBillListForReorder.ihtm?client_id="+clientId+"&search_key="+searchKey;
	}
	function doGo(pageIndex){
		var searchKey=encodeURIComponent("${searchKey}");
		var clientId="${clientId}";
		window.location="/business/BusinessBillListForReorder.ihtm?client_id="+clientId+"&search_key="+searchKey+"&current_page="+pageIndex;
	}
	function doJump(pageIndex){
		if(window.event.keyCode==13){
			doGo(pageIndex);
		}
	}
	function doDownload(){
		var searchKey=encodeURIComponent("${searchKey}");
		window.location="/business/BusinessBillListForReorder.ihtm?client_id="+clientId+"&search_key="+searchKey+"&content_type=EXCEL";
	}
	function doSelect(index){
		var ob_arr = document.getElementsByName("query_checkbox");
		var str="";
		if ( ob_arr.length>=index){
			str=ob_arr[index-1].value;
		}
		if (str != null && str!=''){
			parent.popRetVal=str;
			parent.ClosePop();
		}
	}
	function DoubleClick(it){
		var ob_arr = document.getElementsByName("query_checkbox");
		var str="";
		if(ob_arr.length>=it.getAttribute("index")){
			str=ob_arr[it.getAttribute("index")-1].value;
		}
		if(str==""){
			return;
		}
		parent.popRetVal=str;
		parent.ClosePop();
	}
	function doCancel(){
		parent.ClosePop();
	}
	function doInit(){
		Window_Onload();
		resizePopwin();
		document.getElementById("search_key").focus();
	}
	function checkSearchKey(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
</script>
</head>
<body oncontextmenu="return false" onLoad="doInit();" class="sheet">
<div class="sheet-main" style="width:855px">
  <div class="sheet-top">
    <div class="content">
      <h2>业务单复制</h2>
      <p>请选择要复制的业务单，系统将自动复制该业务单，帮助你快速开单</p>
    </div>
  </div>
  <div class="sheet-list">
    <div class="search-business">
      <div class="content">
        <table width="748">
          <tbody>
            <tr>
              <td  align="right">
	              <input type="text" class="TextBox" id="search_key" name="search_key" onKeyUp="checkSearchKey();" style="width:100px" value="${searchKey}" title="以客户名称、客户拼音字头、摘要、业务单号进行模糊查询">
	              <input type="button" class="buttom search-but" value=" 查 询" onClick="doSearch();" title="以客户名称、客户拼音字头、摘要、业务单号进行模糊查询">
				</td>
            </tr>    
           </tbody>      
        </table>
      </div>
	  <%@include file="../inc/AlertMsg.jsp"%>
      <div class="table-list">
        <table width="100%">      
 					<tr >
						<th  width="15%">单号</th>
						<th  width="10%">订货日期</th>
						<th  width="25%">订货单位</th>
						<th  width="20%">摘要</th>
						<th  width="10%">交货日期</th>
						<th  width="10%">业务员</th>
						<th  width="10%">操作</th>
					</tr>
				<c:forEach var="item" items="${qr.list}" varStatus="i">
					<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
					<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
					<tr class="${trClass}" index="${i.index+1}" style='cursor:pointer;' ondblclick='javascript:DoubleClick(this)' onClick='javascript:ClickCheck(this)' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)'>
						<td>
							<input type="radio" name='query_checkbox' value="${item[0].id}" style="display:none">
							${item[0].billCode}
						</td>
						<td><fmt:formatDate value="${item[0].orderDate}" pattern="yyyy-MM-dd"/></td>
						<td>${item[1]}<c:if test="${item[0].linkman!=null && item[0].linkman!=''}">(${item[0].linkman})</c:if></td>
						<td>${item[0].content}</td>
						<td>
							<c:if test="${item[0].deliverDate!=null}">
							<fmt:formatDate value="${item[0].deliverDate}" pattern="yyyy-MM-dd"/>
							</c:if>
						</td>
						<td>${item[0].managerName}</td>
						<td>
							<a href="javascript:doSelect('${i.index+1}');">选择</a>
						</td>
					</tr>
				</c:forEach>
			</table>
			<%@include file="../inc/Pages.jsp"%>
      </div>     
    </div>
  </div>
</div>
</body>
</html>